package edu.whut.jdk8.localClass;

import java.sql.SQLOutput;
import java.time.LocalDate;
import java.time.LocalDateTime;

/*
修改
 */
public class update {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        System.out.println(now.minusDays(1));//减一天
        //加上：minusHours、Years......
        //减去：plusYears\Mouths......

        //调用完之后都会返回一个新的对象返还回来
        System.out.println(now);

        //修改
        //now.withYear(2020)......

        //比较
        LocalDate date1 = LocalDate.of(2020,10,1);
        LocalDate date2 = LocalDate.now();
        System.out.println(date1.isBefore(date2));
        System.out.println(date1.isAfter(date2));
        System.out.println(date1.isEqual(date2));
    }
}
